<template>
  <div>
    <el-card>
      <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
        <el-tab-pane label="我创建的公司" name="myCreatCompany">
            <myCreatCompany v-if="activeName=='myCreatCompany'"></myCreatCompany>
        </el-tab-pane>
        <el-tab-pane label="我任职的公司" name="mineCompany">
            <mineCompany v-if="activeName=='mineCompany'"></mineCompany>
        </el-tab-pane>
      </el-tabs>

    </el-card>
  </div>
</template>
<script>
import mineCompany from  "./mineCompany.vue"
import myCreatCompany from  "./myCreatCompany.vue"
export default {
  components: {
      mineCompany,
      myCreatCompany
  },
  data() {
    return {
         activeName: 'myCreatCompany',//选项卡默认选择
    };
  },
  methods: {
      /*选项卡改变时触发的事件 */
      handleClick(tab, event) {
        console.log(tab, event);
      }
  },
  mounted(){
    if(this.$route.query.activeName){
      this.activeName=this.$route.query.activeName
    }
  },
  created(){},
};
</script>
<style lang="scss"  scoped>
</style>
